/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.group4.highschoolportal.student.backingbean;


import com.group4.controller.CourseFacade;

import com.group4.controller.StudentFacade;
import com.group4.entity.Course;
import com.group4.entity.User;
import java.util.List;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

/**
 *
 * @author José
 */
@ManagedBean
@RequestScoped
public class StudentCoursesBackingBean {
    
    @EJB
    private CourseFacade courseDb;
    @EJB
    private StudentFacade studentDb;
    private List<Course> courses;
    
    private User user;

    

    /** Creates a new instance of StudentCoursesBackingBean */
    public StudentCoursesBackingBean() {
        
    }

    public void setCourses(List<Course> courses) {
        this.courses = courses;
    }

    public List<Course> getCourses() {
        courses = courseDb.findAll();
        for (Course s : courses) {
            System.out.println(s.toString());
        }
        return courses;
    }
    public User getUser() {
        
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }
    
  
}
